<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_SESSION['forward_url']='jy_jd/home/';
cfc('core')->checklogin();
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
    $member=pdo_get('core_members',array('id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),array('credit1','credit2','mobile','groupid','avatar','nickname'));
	if(!member){
		exi('找不到会员信息！','error');
	}	
	$return['item']=$member;	
	exi($return);
}

//修改用户信息
if($_RQ['op']=='set'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$data=array(
				'realname'=>$postdata['realname'],
				'mobile'=>$postdata['mobile'],
				'avatar'=>$postdata['avatar'],
				'address'=>$postdata['address'],
				);
		$user_id=pdo_getcolumn('core_members',array('id'=>$_SESSION['uid']),'id');		
		if($user_id){
			pdo_update('core_members',$data,array('id'=>$_SESSION['uid']));
			exi('修改成功','','home/');		 
		}
	}
	$member=pdo_get('core_members',array('id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	$return['member']=$member;
	exi($return);
	}
